{extend name="public/base" /}
{block name="head"}

{/block}
{block name="body"}
<div id="fuyun-app" class="fuyun-app">
  <div class="fuyun-title">
    <h5>修改密码</h5>
    <a href="{:Url('index')}" class="layui-btn fuyun-add-btn layui-btn-small layui-btn-normal"><i class="fa fa-plus-square margin-right-5"></i>返回</a>
  </div>
  <div class="content-box">
		<form class="layui-form padding-10" method="post">
			<div class="left-box">
				<div class="layui-form-item">
					<label class="layui-form-label">旧的密码</label>
					<div class="layui-input-inline">
						<input type="password" name="old-password" placeholder="请输入旧的密码" class="layui-input">
					</div>
					<div class="layui-form-mid layui-word-aux">忘记老密码请联系管理员</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">新密码</label>
					<div class="layui-input-inline">
						<input type="password" name="password" placeholder="请输入新密码" class="layui-input">
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">确认新密码</label>
					<div class="layui-input-inline">
						<input type="password" name="repassword" placeholder="请输入确认新密码" class="layui-input" value="">
					</div>
				</div>

				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit lay-filter="ajaxForm">立即提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</div>
		</form>
	</div>
</div>

<script type="text/javascript">

	layui.use(['form','layer'], function(){
  		var form = layui.form();
		form.on('submit(ajaxForm)', function(data){
			var that = this;
			// $(that).attr("disabled","disabled");
			$.ajax({ 
				type: "post", 
				url: data.form.action, 
				data: data.field,
				dataType: 'json', 
				success: function(result){ 
					if(result['code'] == 1){
						layer.msg(result['msg']);
            window.setTimeout(function(){
              window.location.reload(); 
            },800);
					}else{
						layer.msg(result['msg']);
						$(that).removeAttr("disabled");
					}
				} 
			});
			return false;
		});
	})
</script>
{/block}



		